(function(t) {
    t.fn.gLoad = function(e, i) {
        if (typeof e == "function") {
            e = {e: e}
        }
        if (parseInt(i) > 0) {
            e.df = i
        }
        var n = {df: 20, e: null, et: "scroll", ct: window};
        if (e) {
            t.extend(n, e)
        }
        var o = this;
        if ("scroll" == n.et) {
            t(n.ct).bind("scroll", function() {
                o.each(function() {
                    if (!t.gIsKs(this, n)) {
                        t(this).trigger("appear")
                    }
                });
                var e = t.grep(o, function(t) {
                    return!t.loaded
                });
                o = t(e)
            })
        }
        this.each(function() {
            var e = this;
            e.loaded = false;
            t(e).one("appear", function() {
                if (!this.loaded) {
                    if (n.e != null && n.e != "")
                        n.e.apply(e);
                    e.loaded = true
                }
            });
            if ("scroll" != n.et) {
                t(e).bind(n.et, function(i) {
                    if (!e.loaded) {
                        t(e).trigger("appear")
                    }
                })
            }
        });
        t(window).scroll();
        return this
    };
    t.gIsKs = function(e, i) {
        if (i.ct === undefined || i.ct === window) {
            var n = t(window).height() + t(window).scrollTop()
        } else {
            var n = t(i.ct).offset().top + t(i.ct).height()
        }
        return n <= t(e).offset().top - i.df
    }
})(jQuery);
(function(t) {
    t.fn.gCity = function(c) {
        var i = function(t, c) {
            this.cache = {snam: "", sid: "", cnam: "", cid: "", xnam: "", xid: "", znam: "", zid: "", chtm: ""};
            this.adress = "11011400|北京北京市东城区东城区|11010000|11000000|110114001";
            this.province = {11000000: "北京", 12000000: "天津", 13000000: "河北省", 14000000: "山西省", 15000000: "内蒙古", 21000000: "上海", 22000000: "浙江省", 23000000: "江苏省", 24000000: "安徽省", 25000000: "福建省", 26000000: "山东省", 31000000: "广东省", 32000000: "广西", 33000000: "海南省", 41000000: "湖北省", 42000000: "湖南省", 43000000: "河南省", 44000000: "江西省", 51000000: "黑龙江省", 52000000: "吉林省", 53000000: "辽宁省", 61000000: "宁夏", 62000000: "新疆", 63000000: "青海省", 64000000: "陕西省", 65000000: "甘肃省", 71000000: "四川省", 72000000: "云南省", 73000000: "贵州省", 74000000: "重庆市", 75000000: "西藏", 81000000: "台湾省", 82000000: "香港", 83000000: "澳门", 84000000: "钓鱼岛"};
            this.city = {11000000: {11010000: "北京市"}, 12000000: {12010000: "天津市"}, 13000000: {13010000: "保定市", 13020000: "沧州市", 13030000: "承德市", 13040000: "邯郸市", 13050000: "衡水市", 13060000: "廊坊市", 13070000: "秦皇岛市", 13080000: "石家庄市", 13090000: "唐山市", 13100000: "邢台市", 13110000: "张家口市", 13990000: "河北省其他城市"}, 14000000: {14010000: "长治市", 14020000: "大同市", 14030000: "晋城市", 14040000: "晋中市", 14050000: "临汾市", 14060000: "吕梁市", 14070000: "朔州市", 14080000: "太原市", 14090000: "忻州市", 14100000: "阳泉市", 14110000: "运城市", 14990000: "山西省其他城市"}, 15000000: {15010000: "阿拉善盟", 15020000: "巴彦淖尔市", 15030000: "包头市", 15040000: "赤峰市", 15050000: "鄂尔多斯市", 15060000: "呼和浩特市", 15070000: "呼伦贝尔市", 15080000: "通辽市", 15090000: "乌海市", 15100000: "乌兰察布市", 15110000: "锡林郭勒盟", 15120000: "兴安盟", 15990000: "内蒙古其他城市"}, 21000000: {21010000: "上海市"}, 22000000: {22010000: "杭州市", 22020000: "湖州市", 22030000: "嘉兴市", 22040000: "金华市", 22050000: "丽水市", 22060000: "宁波市", 22070000: "衢州市", 22080000: "绍兴市", 22090000: "台州市", 22100000: "温州市", 22110000: "舟山市", 22990000: "浙江省其他城市"}, 23000000: {23010000: "南京市", 23020000: "淮安市", 23030000: "连云港市", 23040000: "常州市", 23050000: "南通市", 23060000: "苏州市", 23070000: "宿迁市", 23080000: "泰州市", 23090000: "无锡市", 23100000: "徐州市", 23110000: "盐城市", 23120000: "扬州市", 23130000: "镇江市", 23990000: "江苏省其他城市"}, 24000000: {24010000: "合肥市", 24020000: "安庆市", 24030000: "蚌埠市", 24040000: "亳州市", 24060000: "池州市", 24070000: "滁州市", 24080000: "阜阳市", 24090000: "淮北市", 24100000: "淮南市", 24110000: "黄山市", 24120000: "六安市", 24130000: "马鞍山市", 24140000: "宿州市", 24150000: "铜陵市", 24160000: "芜湖市", 24170000: "宣城市", 24990000: "安徽省其他城市"}, 25000000: {25010000: "福州市", 25020000: "龙岩市", 25030000: "南平市", 25040000: "宁德市", 25050000: "莆田市", 25060000: "泉州市", 25070000: "三明市", 25080000: "厦门市", 25090000: "漳州市", 25990000: "福建省其他城市"}, 26000000: {26010000: "滨州市", 26020000: "德州市", 26030000: "东营市", 26040000: "菏泽市", 26050000: "济南市", 26060000: "济宁市", 26070000: "莱芜市", 26080000: "聊城市", 26090000: "临沂市", 26100000: "青岛市", 26110000: "日照市", 26120000: "泰安市", 26130000: "威海市", 26140000: "潍坊市", 26150000: "烟台市", 26160000: "枣庄市", 26170000: "淄博市", 26990000: "山东省其他城市"}, 31000000: {31010000: "广州市", 31020000: "深圳市", 31030000: "潮州市", 31040000: "河源市", 31050000: "惠州市", 31060000: "江门市", 31070000: "揭阳市", 31080000: "茂名市", 31090000: "梅州市", 31100000: "清远市", 31110000: "汕头市", 31120000: "汕尾市", 31130000: "韶关市", 31140000: "阳江市", 31150000: "云浮市", 31160000: "湛江市", 31170000: "肇庆市", 31180000: "珠海市", 31190000: "东莞市", 31200000: "中山市", 31210000: "佛山市", 31990000: "广东省其他城市"}, 32000000: {32010000: "桂林市", 32020000: "百色市", 32030000: "北海市", 32040000: "崇左市", 32050000: "防城港市", 32060000: "贵港市", 32070000: "河池市", 32080000: "贺州市", 32090000: "来宾市", 32100000: "柳州市", 32110000: "南宁市", 32120000: "钦州市", 32130000: "梧州市", 32140000: "玉林市", 32990000: "广西省其他城市"}, 33000000: {33010000: "海口市", 33020000: "白沙县", 33030000: "保亭县", 33040000: "昌江县", 33050000: "澄迈县", 33060000: "儋州市", 33070000: "定安县", 33080000: "东方市", 33090000: "乐东县", 33100000: "临高县", 33110000: "陵水县", 33130000: "琼海市", 33140000: "琼中县", 33150000: "屯昌县", 33160000: "万宁市", 33170000: "文昌市", 33180000: "五指山市", 33210000: "三亚市", 33220000: "三沙市", 33990000: "海南省其他城市"}, 41000000: {41010000: "武汉市", 41020000: "鄂州市", 41030000: "恩施州", 41040000: "黄冈市", 41050000: "黄石市", 41060000: "荆门市", 41070000: "荆州市", 41080000: "十堰市", 41090000: "随州市", 41100000: "咸宁市", 41110000: "襄阳市", 41120000: "孝感市", 41130000: "宜昌市", 41140000: "仙桃市", 41150000: "潜江市", 41160000: "天门市", 41170000: "神农架林区", 41990000: "湖北省其他城市"}, 42000000: {42010000: "长沙市", 42020000: "常德市", 42030000: "郴州市", 42040000: "衡阳市", 42050000: "怀化市", 42060000: "娄底市", 42070000: "邵阳市", 42080000: "湘潭市", 42090000: "湘西州", 42100000: "益阳市", 42110000: "永州市", 42120000: "岳阳市", 42130000: "张家界市", 42140000: "株洲市", 42990000: "湖南省其他城市"}, 43000000: {43010000: "郑州市", 43020000: "安阳市", 43030000: "鹤壁市", 43040000: "焦作市", 43050000: "开封市", 43060000: "洛阳市", 43070000: "漯河市", 43080000: "南阳市", 43090000: "平顶山市", 43100000: "濮阳市", 43110000: "三门峡市", 43120000: "商丘市", 43130000: "新乡市", 43140000: "信阳市", 43150000: "许昌市", 43160000: "周口市", 43170000: "驻马店市", 43180000: "济源市", 43990000: "河南省其他城市"}, 44000000: {44010000: "南昌市", 44020000: "抚州市", 44030000: "赣州市", 44040000: "吉安市", 44050000: "景德镇市", 44060000: "九江市", 44070000: "萍乡市", 44080000: "上饶市", 44090000: "新余市", 44100000: "宜春市", 44110000: "鹰潭市", 44990000: "江西省其他城市"}, 51000000: {51010000: "哈尔滨市", 51020000: "大庆市", 51030000: "大兴安岭", 51040000: "鹤岗市", 51050000: "黑河市", 51060000: "鸡西市", 51070000: "佳木斯市", 51080000: "牡丹江市", 51090000: "七台河市", 51100000: "齐齐哈尔市", 51110000: "双鸭山市", 51120000: "绥化市", 51130000: "伊春市", 51990000: "黑龙江省其他城市"}, 52000000: {52010000: "长春市", 52020000: "白城市", 52030000: "白山市", 52040000: "吉林市", 52050000: "辽源市", 52060000: "四平市", 52070000: "松原市", 52080000: "通化市", 52090000: "延边州", 52990000: "吉林省其他城市"}, 53000000: {53010000: "沈阳市", 53020000: "鞍山市", 53030000: "本溪市", 53040000: "朝阳市", 53050000: "大连市", 53060000: "丹东市", 53070000: "抚顺市", 53080000: "阜新市", 53090000: "葫芦岛市", 53100000: "锦州市", 53110000: "辽阳市", 53120000: "盘锦市", 53130000: "铁岭市", 53140000: "营口市", 53990000: "辽宁省其他城市"}, 61000000: {61010000: "固原市", 61020000: "石嘴山市", 61030000: "吴忠市", 61040000: "中卫市", 61050000: "银川市", 61990000: "宁夏其他城市"}, 62000000: {62010000: "乌鲁木齐市", 62020000: "阿克苏地区", 62030000: "阿勒泰地区", 62040000: "巴音郭楞州", 62050000: "博尔塔拉州", 62060000: "昌吉州", 62070000: "哈密地区", 62080000: "和田地区", 62090000: "喀什地区", 62100000: "克拉玛依市", 62110000: "克孜州", 62120000: "塔城地区", 62130000: "吐鲁番地区", 62140000: "伊犁州", 62150000: "石河子市", 62160000: "阿拉尔市", 62170000: "图木舒克市", 62180000: "五家渠市", 62990000: "新疆省其他城市"}, 63000000: {63010000: "西宁市", 63020000: "果洛州", 63030000: "海北州", 63040000: "海东地区", 63050000: "海南州", 63060000: "海西州", 63070000: "黄南州", 63080000: "玉树州", 63990000: "青海省其他城市"}, 64000000: {64010000: "西安市", 64020000: "安康市", 64030000: "宝鸡市", 64040000: "汉中市", 64050000: "商洛市", 64060000: "铜川市", 64070000: "渭南市", 64080000: "咸阳市", 64090000: "延安市", 64100000: "榆林市", 64990000: "陕西省其他城市"}, 65000000: {65010000: "兰州市", 65020000: "白银市", 65030000: "定西市", 65040000: "甘南州", 65050000: "嘉峪关市", 65060000: "金昌市", 65070000: "酒泉市", 65080000: "临夏州", 65090000: "陇南市", 65100000: "平凉市", 65110000: "庆阳市", 65120000: "天水市", 65130000: "张掖市", 65140000: "武威市", 65990000: "甘肃省其他城市"}, 71000000: {71010000: "成都市", 71020000: "阿坝州", 71030000: "巴中市", 71040000: "达州市", 71050000: "德阳市", 71060000: "甘孜州", 71070000: "广元市", 71080000: "乐山市", 71090000: "凉山州", 71100000: "泸州市", 71110000: "眉山市", 71120000: "绵阳市", 71130000: "内江市", 71140000: "南充市", 71150000: "攀枝花市", 71160000: "遂宁市", 71170000: "雅安市", 71180000: "宜宾市", 71190000: "资阳市", 71200000: "自贡市", 71210000: "广安市", 71990000: "四川省其他城市"}, 72000000: {72010000: "昆明市", 72020000: "保山市", 72030000: "楚雄州", 72040000: "大理州", 72050000: "德宏州", 72060000: "迪庆州", 72070000: "红河州", 72080000: "丽江市", 72090000: "临沧市", 72100000: "怒江州", 72110000: "曲靖市", 72120000: "普洱市", 72130000: "文山州", 72140000: "西双版纳州", 72150000: "玉溪市", 72160000: "昭通市", 72990000: "云南省其他城市"}, 73000000: {73010000: "贵阳市", 73020000: "安顺市", 73030000: "毕节市", 73040000: "六盘水市", 73050000: "黔东南州", 73060000: "黔南州", 73070000: "黔西南州", 73080000: "铜仁市", 73090000: "遵义市", 73990000: "贵州省其他城市"}, 74000000: {74010000: "重庆市"}, 75000000: {75010000: "拉萨市", 75020000: "阿里地区", 75030000: "昌都地区", 75040000: "林芝地区", 75050000: "那曲地区", 75060000: "日喀则地区", 75070000: "山南地区", 75990000: "西藏其他城市"}, 81000000: {81010000: "台湾省"}, 82000000: {82010000: "香港"}, 83000000: {83010000: "澳门"}, 84000000: {84010000: "钓鱼岛"}};
            this.opt = c;
            this.singleCity = {11000000: "11010000", 12000000: "12010000", 21000000: "21010000", 74000000: "74010000"};
            this.obj = t;
            this.init()
        };
        i.prototype = {init: function() {
                var t = this;
                t.winClose();
                t.obj.click(function() {
                    t.bindEvent();
                    t.obj.addClass("gctCur").parent().addClass("cityShow");
                    if (t.opt.gc_new)
                        t.opcity(1);
                    t.winType(true)
                });
                t.autoProvince()
            }, autoProvince: function() {
                var t = this, c = {};
                t.cityModel(t.province)
            }, bindEvent: function() {
                var c = this;
                t(c.opt.gc_shw).unbind("click").click(function(t) {
                    c.cityClick(c.getEvent(t))
                })
            }, cityModel: function(c) {
                var i = this.opt.gc_dat || t.cookie("atgregion");
                i = i || this.adress;
                i = i.split("|");
                if (i.length != 5 || i[4] == "undefined")
                    i[4] = i[0] + "1";
                this.cache.sid = i[3];
                this.cache.cid = i[2];
                this.cache.xid = i[0];
                this.cache.zid = i[4];
                this.cityDom(c, 2, 1)
            }, cityDom: function(c, i, a) {
                var e = c.citys || c;
                if (a == 1) {
                    this.createProvince(e, i)
                } else {
                    this.createOthers(e, a, i)
                }
                if (!this.opt.gc_inp && e.length <= 1 && i == 4)
                    this.inpcity();
                if (this.opt.gc_inp && i == 4) {
                    this.opt.gc_inp = false;
                    this.citySlect();
                    this.cache.chtm = this.fmtAddress();
                    if (this.opt.gc_ads)
                        t(this.opt.gc_aid).html(this.cache[this.opt.gc_ads]).attr("title", this.cache[this.opt.gc_ads]);
                    if (this.opt.gc_autofn)
                        this.opt.gc_autofn.apply(this.cache)
                }
                this.bindEvent()
            }, checkData: function(t) {
                try {
                    var c = t.result.division, i = c[0].code + c[0].label;
                    return true
                } catch (a) {
                    if (window.console) {
                        console.log("响应数据异常\r\n" + a)
                    }
                    return false
                }
            }, createProvince: function(c, i) {
                var a = this, e = "";
                t.each(c, function(t, c) {
                    var n = t, s = c, h = "";
                    e += a.createSpan(h, s, n, n + "," + i + ",1")
                });
                a.cityHtm(e)
            }, createOthers: function(c, i, a) {
                var e = this, n = "", s = "", h = "", r = c;
                if (a != 2) {
                    if (!this.checkData(c))
                        return false;
                    c = c.result.division
                }
                t.each(c, function(t, c) {
                    var i = c.code ? c.code : t, r = c.label ? c.label : c, o = c.relationCode || null, d = "";
                    s = i;
                    h = r;
                    if (i == e.cache.cid) {
                        e.cache.cnam = r
                    }
                    if (i == e.cache.xid && !o || i != e.cache.xid && o && o == e.cache.xid) {
                        e.cache.xid = i;
                        e.cache.xnam = e.fmt(r)
                    }
                    if (e.cache.zid && e.cache.zid != "" && i == e.cache.zid) {
                        e.cache.znam = e.fmt(r)
                    }
                    n += e.createSpan(d, r, i, i + "," + (parseInt(a) + 1) + "," + a, o)
                });
                t("#ctbox_" + a).html(n);
                var o = 0;
                if (a == 2) {
                    o = e.cache.sid;
                    if (e.opt.gc_inp)
                        e.autoAjax(e.cache.cid, parseInt(a) + 1, a);
                    if (!e.opt.gc_inp && c.length <= 1) {
                        e.cache.cid = s;
                        e.autoAjax(e.cache.cid, parseInt(a) + 1, a)
                    }
                }
                if (a == 3) {
                    o = e.cache.cid;
                    if (e.opt.gc_inp)
                        e.autoAjax(e.cache.xid, parseInt(a) + 1, a)
                }
                if (a == 4) {
                    o = e.cache.xid;
                    if (c.length <= 1) {
                        e.cache.zid = s;
                        e.cache.znam = h
                    }
                }
                e.obj.data("data" + o, r)
            }, autoAjax: function(t, c, i) {
                var a = this;
                window.setTimeout(function() {
                    a.cityajax(t, c, i)
                }, 1)
            }, createSpan: function(t, c, i, a, e) {
                if (e)
                    e = 'data-rid="' + e + '"';
                return'<span><a href="javascript:;" ' + t + ' title="' + c + '" id="ct' + i + '" data-val="' + a + '" ' + (e ? e : "") + ">" + c + "</a></span>"
            }, citySlect: function() {
                t("#pct_1").find("b").html(this.cache.snam);
                t("#pct_2").find("b").html(this.cache.cnam);
                t("#pct_3").find("b").html(this.cache.xnam);
                t("#pct_4").find("b").html(this.cache.znam);
                if (this.cache.xnam == "" || this.cache.xnam == undefined) {
                    var c = this;
                    c.opt.gc_dat = c.adress;
                    c.opt.gc_inp = true;
                    window.setTimeout(function() {
                        c.init()
                    }, 1);
                    return false
                }
            }, cityHtm: function(c) {
                var i = this.opt.gc_css, a = "";
                if (this.opt.gc_slt) {
                    a = '<div id="citySelect" class="gctSelect clearfix">				<a href="javascript:;" id="pct_1" data-val="1" data-lnk><b></b><i></i></a>				<a href="javascript:;" id="pct_2" data-val="2" data-lnk><b></b><i></i></a>				<a href="javascript:;" id="pct_3" data-val="3" data-lnk><b></b><i></i></a>				<a href="javascript:;" id="pct_4" data-val="4" data-lnk class="cur"><b></b><i></i></a>				<a href="javascript:;" id="cityClose" class="close"></a></div>'
                }
                var e = '<div id="cityMBox">				<div class="' + i + '" id="ctbox_1">' + c + '</div>				<div class="' + i + '" id="ctbox_2"></div>				<div class="' + i + '" id="ctbox_3"></div>				<div class="' + i + '" id="ctbox_4"></div></div>';
                t(this.opt.gc_shw).html(a + e);
                this.autoAjax(this.cache.sid, 2, 1)
            }, cityClick: function(c) {
                var i = t(c), a = i.parent(), e = this, n = true;
                if (a.attr("data-lnk") || a.attr("data-lnk") == "") {
                    n = false
                } else {
                    if (i.attr("data-lnk") || i.attr("data-lnk") == "") {
                        n = false
                    }
                }
                if (a.parent().hasClass("gctBox"))
                    a.parent().find("a").removeClass("select");
                if (n) {
                    if (i.attr("id") && i.attr("id") == "cityClose") {
                        e.closeCity();
                        return false
                    }
                    var s = i.attr("data-val"), h = 1;
                    if (s != undefined) {
                        t(e.opt.gc_shw).unbind("click");
                        s = s.split(",");
                        h = s[2];
                        var r = s[0], o = e.fmt(t("#ct" + r).html());
                        if (h == 1) {
                            e.cache.snam = o;
                            e.cache.sid = r;
                            e.setLoading("#ctbox_2,#ctbox_3,#ctbox_4", s);
                            if (this.getPropertyCount(this.city[r]) == 1) {
                                this.cityClick(t("#ct" + this.singleCity[r]))
                            }
                        }
                        if (h == 2) {
                            e.cache.cnam = o;
                            e.cache.cid = r;
                            e.setLoading("#ctbox_3,#ctbox_4", s)
                        }
                        if (h == 3) {
                            e.cache.xnam = o;
                            e.cache.xid = r;
                            e.setLoading("#ctbox_4", s)
                        }
                        if (h == 4) {
                            e.cache.znam = o;
                            e.cache.zid = r;
                            e.inpcity()
                        }
                    }
                } else {
                    var d = i.attr("data-val");
                    if (d == undefined) {
                        e.opcity(i.parent().attr("data-val"))
                    } else {
                        e.opcity(d)
                    }
                }
                e.winType(true)
            }, setLoading: function(c, i) {
                t(c).html("加载中...");
                this.cityajax(i[0], i[1], i[2])
            }, getPropertyCount: function(t) {
                var c, i = 0;
                for (c in t) {
                    if (t.hasOwnProperty(c)) {
                        i++
                    }
                }
                return i
            }, winClose: function() {
                var c = this;
                t("body:first").click(function(i) {
                    var a = t(c.opt.gc_shw).attr("cityType");
                    if (a == "true") {
                        var e = t(c.getEvent(i)), n = e.attr("id");
                        if (!e.attr("cityType") && !e.parent().attr("cityType") && !e.parent().parent().attr("cityType") && !e.parent().parent().parent().attr("cityType") && !e.parent().parent().parent().parent().attr("cityType") && n != "stockaddress" && n != "address" && e.parent().attr("id") != "address") {
                            c.winType(false);
                            c.closeCity()
                        }
                    } else {
                        c.closeCity()
                    }
                })
            }, winType: function(c) {
                t(this.opt.gc_shw).attr("cityType", "" + c)
            }, cityajax: function(c, i, a) {
                var e = "", n = 0;
                this.opcity(i);
                if (a == 1) {
                    this.setDataClk("#pct_2", true);
                    this.setDataClk("#pct_3,#pct_4", false);
                    e = t("#ct" + this.cache.sid).html();
                    n = this.cache.sid;
                    this.cache.snam = e
                }
                if (a == 2) {
                    this.setDataClk("#pct_3", true);
                    this.setDataClk("#pct_4", false);
                    e = t("#ct" + this.cache.cid).html();
                    n = this.cache.cid;
                    this.cache.cnam = e
                }
                if (a == 3) {
                    this.setDataClk("#pct_4", true);
                    e = this.fmt(t("#ct" + this.cache.xid).html());
                    n = this.cache.xid;
                    this.cache.xnam = e
                }
                if (a == 4) {
                    e = this.fmt(t("#ct" + this.cache.zid).html());
                    this.cache.znam = e
                }
                t("#pct_" + a).find("b").html(e);
                if (n != 0)
                    this.getDataCache(n, i, c)
            }, fmt: function(t) {
                if (t)
                    return t.replace("*", "")
            }, fmtAddress: function() {
                try {
                    return this.cache.snam + this.cache.cnam.replace(this.cache.snam, "") + this.cache.xnam.replace(this.cache.cnam, "").replace(this.cache.snam, "") + this.cache.znam.replace(this.cache.cnam, "").replace(this.cache.snam, "")
                } catch (t) {
                    return""
                }
            }, setDataClk: function(c, i) {
                if (!this.opt.gc_inp) {
                    if (i) {
                        t(c).attr("data-clk", i).find("b").html("请选择")
                    } else {
                        t(c).hide().attr("data-clk", i).find("b").html("请选择")
                    }
                }
            }, getDataCache: function(t, c, i) {
                if (this.obj.data("data" + t)) {
                    this.cityDom(this.obj.data("data" + t), c, t);
                    return false
                } else {
                    var e = "", n = {citycode: i, levelid: c};
                    if (c == 2) {
                        this.cityDom(this.city[i], c, i)
                    } else if (c == 3) {
                        e = a + n.citycode + "/3/flag/item_web/gcity_callbackarea";
                        this.getDataAjax(i, c, e)
                    } else {
                        e = a + n.citycode + "/4/flag/item_web/gcity_callbackarea";
                        this.getDataAjax(i, c, e)
                    }
                }
            }, getDataAjax: function(c, i, a) {
                var e = this;
                t.ajax({type: "get", url: a, cache: true, dataType: "jsonp", data: {}, jsonpName: "gcity_callbackarea", success: function(t) {
                        e.cityDom(t, i, c)
                    }})
            }, getCookie: function(t) {
                if (document.cookie.length > 0) {
                    c_start = document.cookie.indexOf(t + "=");
                    if (c_start != -1) {
                        c_start = c_start + t.length + 1;
                        c_end = document.cookie.indexOf(";", c_start);
                        if (c_end == -1)
                            c_end = document.cookie.length;
                        return decodeURIComponent(document.cookie.substring(c_start, c_end))
                    }
                }
                return""
            }, inpcity: function() {
                var c = this, i = "";
                c.cache.chtm = c.fmtAddress();
                i = c.cache.chtm;
                if (c.opt.gc_ads) {
                    i = c.cache[c.opt.gc_ads]
                }
                t("#pct_4").find("b").html(c.cache.znam);
                t(c.opt.gc_aid).html(i).attr("title", i);
                c.closeCity();
                if (c.opt.gc_evt) {
                    var a = c.cache.xid;
                    if (t("#ct" + c.cache.zid).attr("data-rid"))
                        a = t("#ct" + c.cache.zid).attr("data-rid");
                    c.opt.gc_evt.apply(t.extend({}, c.cache, {xid: a}))
                }
                c.afterSavefn()
            }, afterSavefn: function() {
                var c = this.getCookie("atgregion") || "11011400|北京北京市东城区东城区|11010000|11000000|110114001";
                var i = c.split("|");
                var a = {p: i[3], c1: i[2], c2: i[0], t: i[4] == undefined ? "" : i[4]};
                var e = "http://cart" + cookieDomain + "/api/district/changeTransportDistrict";
                t.ajax({type: "get", dataType: "jsonp", data: a, jsonpName: "updateCity", url: e, success: function() {
                    }})
            }, opcity: function(c) {
                for (var i = 1; i < 5; i++) {
                    if (i == c) {
                        t("#ctbox_" + i).show();
                        t("#pct_" + i).addClass("cur").show()
                    } else {
                        t("#ctbox_" + i).hide();
                        t("#pct_" + i).removeAttr("class")
                    }
                }
            }, getEvent: function(t) {
                t = t || window.event;
                return t.target || t.srcElement
            }, closeCity: function() {
                this.obj.removeClass("gctCur").parent().removeClass("cityShow")
            }};
        var a = "http://ss" + (cookieDomain || "") + "/item/v1/region/";
        var e = {gc_dat: null, gc_css: "gctBox", gc_shw: ".gCity", gc_aid: "#stockaddress", gc_ads: null, gc_inp: true, gc_upd: true, gc_slt: true, gc_new: false, gc_autofn: null, gc_group: false, gc_groupID: false, gc_evt: null}, c = t.extend(e, c);
        this.each(function() {
            new i(t(this), c)
        })
    }
})(jQuery);
var pageNav = {pre: "上一页", next: "下一页", nav: function(t, a) {
        var s = "";
        if (a <= 1 || t > a) {
            s = this.pager(1, 1)
        } else {
            s += t == 1 ? this.showPre(0) : this.showPre(1, t);
            if (a > 6) {
                var e = 1;
                if (t >= 5 && t <= a) {
                    s += t == 1 ? this.numStatusHTML(0, 1) : this.numStatusHTML(1, 1)
                } else {
                    for (var n = 1; n < 4; n++) {
                        s += t == n ? this.numStatusHTML(0, n) : this.numStatusHTML(1, n)
                    }
                }
                s += t >= 5 ? "<span class='placeholder'></span>" : "";
                e = t - 2;
                if (e >= 3 && e < a - 2)
                    s += t == e ? this.numStatusHTML(0, e) : this.numStatusHTML(1, e);
                e = t - 1;
                if (e > 3 && e < a - 2)
                    s += t == e ? this.numStatusHTML(0, e) : this.numStatusHTML(1, e);
                e = t;
                if (e > 3 && e < a - 2)
                    s += t == e ? this.numStatusHTML(0, e) : this.numStatusHTML(1, e);
                e = t + 1;
                if (e > 3 && e < a - 2)
                    s += t == e ? this.numStatusHTML(0, e) : this.numStatusHTML(1, e);
                e = t + 2;
                if (e > 3 && e < a - 2)
                    s += t == e ? this.numStatusHTML(0, e) : this.numStatusHTML(1, e);
                s += t <= a - 4 ? "<span class='placeholder'></span>" : "";
                if (t <= a - 4) {
                    s += t == a ? this.numStatusHTML(0, a) : this.numStatusHTML(1, a)
                } else {
                    for (var n = a - 2; n <= a; n++) {
                        s += t == n ? this.numStatusHTML(0, n) : this.numStatusHTML(1, n)
                    }
                }
            } else {
                for (var n = 1; n <= a; n++) {
                    s += t == n ? this.numStatusHTML(0, n) : this.numStatusHTML(1, n)
                }
            }
            s += t == a ? this.showNext(0) : this.showNext(1, t)
        }
        return s
    }, pager: function(t, a) {
        var s = "";
        if (a <= 1) {
            this.p = t;
            this.pn = a;
            s = this.showPre(0) + this.numStatusHTML(0, t) + this.showNext(0)
        }
        return s
    }, go: function(t, a) {
        var s = this.nav(t, a) + this.btnHTML(t, a);
        return s
    }, numStatusHTML: function(t, a) {
        return t == 0 ? "<span class='cur'>" + a + "</span>" : "<a href='javascript:void(0);' onclick='javascript:doPageNumSearch(" + a + ");return false;'>" + a + "</a>"
    }, showPre: function(t, a) {
        var s = "<a class='prev disable' href='javascript:void(0);'>&nbsp;" + this.pre + "<s class='icon-prev'></s><i></i></a>";
        var e = "<a class='prev' href='javascript:void(0);' onclick='javascript:doPageNumSearch(" + (a - 1) + ");return false;'>&nbsp;" + this.pre + "<s class='icon-prev'></s><i></i></a>";
        return t == 0 ? s : e
    }, showNext: function(t, a) {
        var s = "<a class='next disable' href='javascript:void(0);'>" + this.next + "<s class='icon-next'></s><i></i></a>";
        var e = "<a class='next' href='javascript:void(0);' onclick='javascript:doPageNumSearch(" + (a + 1) + ");return false;'>" + this.next + "<s class='icon-next'></s><i></i></a>";
        return t == 0 ? s : e
    }, btnHTML: function(t, a) {
        var s = "<label for='pagenum' class='txt-wrap'>到<input type='text' id='pNum' class='txt' bNum='" + a + "' value='" + t + "'>页</label>" + "<a href='javascript:void(0)' zdx='nBtn' class='btn'>确定</a>";
        return s
    }};
(function(t) {
    t.fn.extend({ucPager: function(a) {
            var s = t.extend({currentPage: 1, totalPage: 0, pageSize: 15, clickCallback: function() {
                }}, a);
            return this.each(function() {
                var a = t(this);
                var e = function() {
                    s.clickCallback(s.currentPage)
                };
                a.html(pageNav.go(s.currentPage, s.totalPage));
                window.doPageNumSearch = function(t) {
                    s.currentPage = t.toString();
                    e()
                };
                window.doNextPageNum = function(t) {
                    if (s.currentPage == s.totalPage) {
                        s.currentPage--
                    } else {
                        s.currentPage++
                    }
                    doPageNumSearch(s.currentPage)
                };
                var n = t("#pNum", a);
                n.on("keyup", function(s) {
                    var e = t(this).val(), n = /^\d+$/gi, i = /\d+/gi;
                    if (s.which == 13) {
                        t(".btn", a).click()
                    } else {
                        if (!n.test(e)) {
                            t(this).val(e.match(i) ? e.match(i)[0] : "")
                        }
                    }
                });
                t(".btn", a).bind("click", function() {
                    var a = t.trim(n.val());
                    if (a < 1) {
                        n.val(1);
                        s.currentPage = 1 + ""
                    } else if (a > s.totalPage) {
                        n.val(s.totalPage);
                        s.currentPage = s.totalPage.toString()
                    } else {
                        n.val(a);
                        s.currentPage = a
                    }
                    e()
                })
            })
        }})
})(jQuery);
var searchBase = {getAjax: function(a) {
        var e = {};
        e.data = undefined;
        try {
            var t = $.ajax({type: "get", url: a.Url, data: a.RequestData || {}, dataType: a.dataType || "jsonp", jsonpName: a.JsonpName || "", jsonpCallback: a.JsonpName || "", timeout: 5e3, beforeSend: function() {
                    if (a.BeforeSend) {
                        a.BeforeSend.apply()
                    }
                }, success: function(t) {
                    e.data = t;
                    if (a.Param)
                        e.Param = a.Param;
                    if (a.Callback) {
                        a.Callback.apply(e)
                    }
                }, error: function(a, e) {
                }, complete: function(a, e) {
                    if (e == "timeout") {
                        t.abort()
                    }
                }})
        } catch (s) {
        }
    }, showMask: function() {
        var a = $('<div id="mask-overlay" class="mask-overlay"></div>').appendTo("body");
        var e = $("body").height(), t = $(window).height();
        $h = Math.max(e, t);
        a.height($h + 20)
    }, addMaskContent: function(a, e) {
        $("#mask-overlay").remove();
        $("#mask-box").remove();
        var t = $('<div class="mask-box" id="mask-box"><a class="mask-close closeBtn" href="javascript:void(0);">╳</a><div class="mask-content-warp" id="mask-content-warp">' + a + "</div></div>").appendTo("body");
        var s = t.height(), o = t.width();
        t.css({"margin-left": -(o / 2), "margin-top": -(s / 2)});
        if (e && typeof e == "function") {
            e.apply()
        }
        $(".closeBtn").bind("click", function() {
            $("#mask-overlay").remove();
            t.remove()
        })
    }, addCollection: function(a, e, t, s, o) {
        $.ajax({type: "get", url: "http://ss" + cookieDomain + "/item/v1/sc/" + a + "/" + e + "/" + t + "/homeSite/flag/sc/wishlist", dataType: "jsonp", beforeSend: searchBase.showMask, jsonpCallback: s, success: function(a) {
                var e = a.errorType;
                var t = "";
                var s = function() {
                };
                switch (e) {
                    case"isError":
                        t = '<div class="mask-icon icon-waring"></div><h3 class="mask-tit">错误！</h3>';
                        break;
                    case"isSuccess":
                        t = '<div class="mask-icon"></div><h3 class="mask-tit">成功加入收藏夹！</h3><p id="collecion-content-n">' + o + "</p>";
                        break;
                    case"isCollect":
                        t = '<div class="mask-icon icon-waring"></div><h3 class="mask-tit">您已收藏过此商品！</h3><p id="collecion-content-n">' + o + "</p>";
                        a:break;
                    default:
                        break
                }
                t = t + '<div class="mask-addCart-btn"><a class="mask-shopping closeBtn" href="javascript:void(0);">继续购物</a><a class="link" href="http://myhome' + cookieDomain + '/member/myFavorites" target="_blank">查看收藏夹</a></div>';
                searchBase.addMaskContent(t, s)
            }})
    }, addCart: function(a, e, t, s) {
        $.ajax({type: "get", url: a, dataType: "jsonp", jsonpCallback: t, data: e, beforeSend: searchBase.showMask, success: function(a) {
                var e = function() {
                };
                if (a.error && a.error.data) {
                    var t = a.error.data, s = "";
                    switch (t.code) {
                        case"gomeSKU":
                            s = "您购物车中的商品种类已达上限" + t.quantityMax + "种";
                            break;
                        case"bookSKU":
                            s = "您购物车中的图书种类已达上限" + t.quantityMax + "种";
                            break;
                        case"bbcSKU":
                            s = "您购物车中的店铺商品种类已达上限" + t.quantityMax + "种";
                            break;
                        case"gomeQuantity":
                            s = "您购物车中的相同商品购买数量不能大于" + t.quantityMax + "件";
                            break;
                        case"bookQuantity":
                            s = "您购物车中的相同图书购买数量不能大于" + t.quantityMax + "件";
                            break;
                        case"bbcQuantity":
                            s = "您购物车中的相同店铺商品购买数量不能大于" + t.quantityMax + "件";
                            break;
                        case"bbcQuantityForLimitBuy":
                            s = t.message;
                            break;
                        default:
                            s = "该商品暂无法购买，请您联系客服解决：4008-708-708";
                            break
                    }
                    s = '<div class="mask-icon icon-waring"></div><h3 class="mask-tit">添加失败</h3><div class="mask-text">' + s + "</div>";
                    searchBase.addMaskContent(s, e)
                }
                if (a.result && a.result.cart) {
                    var o = a.result.cart.cartSummary, i = "";
                    i = o.totalQuantity + "" + o.totalAmount;
                    i = '<div class="mask-icon"></div><h3 class="mask-tit">添加成功</h3><div class="mask-text">购物车共有<strong>' + o.totalQuantity + "</strong>件商品，商品总价：<strong>¥" + o.totalAmount + "</strong></div>";
                    i += '<div class="mask-addCart-btn"><a href="' + dynSite + '/ec/homeus/cart/cart.jsp" class="mask-gotoCart">去购物车结算&nbsp;&gt;</a><a class="mask-shopping closeBtn">继续购物</a></div>';
                    searchBase.addMaskContent(i, e)
                }
            }})
    }, addCartNew: function(a, e, t) {
        window.open(dynSite + contextPath + "/n/success/index.jsp?productId=" + a + "&catalogRefId=" + e + "&_l=" + t)
    }, arrivalNotice: function(a) {
        $.ajax({type: "get", url: a + "notice", dataType: "jsonp", jsonpCallback: "notice", success: function(a) {
                var e = setTimeout(function() {
                    $("#mask-overlay").remove();
                    $("#mask-box").remove()
                }, 3e3);
                searchBase.addMaskContent(a.message, e)
            }})
    }, exp: {otherCard: /^[0-9.]*$/, normal: /^[a-zA-Z0-9&\u4e00-\u9fa5]+$/, email: /^[a-zA-Z0-9]+([._\\-]*[a-zA-Z0-9]+)@[A-Za-z0-9]+\.[a-z]{2,4}$/, telphone: /^(1)\d{10}$/}, replacePrice: function(a, e) {
        var t = $(a).val();
        if (!searchBase.exp.otherCard.test(e)) {
            $(a).val(e.replace(/[A-Za-z`~!@#$%^&*_+=¥￥（）()<>?:"{},\/;'[\]！。......，…——、‘；—【】|？》《“：\\\-” \u4e00-\u9fa5]/g, ""))
        }
    }, check_email: function(a, e) {
        if (searchBase.exp.email.test(a) && a !== "") {
            e.html("").hide();
            return true
        } else if (a == "") {
            e.html("<i></i>请填写邮箱地址").show();
            return false
        } else {
            e.html("<i></i>请填写正确的邮箱地址").show();
            return false
        }
    }, check_phone: function(a, e) {
        if (searchBase.exp.telphone.test(a) && a != "") {
            e.html("").hide();
            return true
        } else if (a == "") {
            e.html("<i></i>请填写手机号码").show();
            return false
        } else {
            e.html("<i></i>请填写正确的手机号码").show();
            return false
        }
    }, replaceNormal: function(a, e) {
        var t = $(a).val();
        if (!searchBase.exp.otherCard.test(e)) {
            $(a).val(e.replace(/[`~!@#$%^&*_+=¥￥（）()<>?:"{},\/;'[\]！。......，…——、‘；—【】|？》《“：\\\-”]/g, ""))
        }
    }};